import { Component } from '@angular/core';
import { NavController, NavParams, ViewController } from 'ionic-angular';
import { Api } from '../../../providers/api-service';


/**
 * 动态
 * 
 * @export
 * @class DynamicPage
 */
@Component({
  selector: 'page-dynamic',
  templateUrl: 'dynamic.html',
})
export class DynamicPage {

  constructor(
    public navCtrl: NavController,
    public viewCtrl: ViewController,
    public api: Api,
    public navParams: NavParams) {
    this.GetGroupByUserId();
  }
  DaKa = {
    "Describe": "sample string 4",
    "VideoUrl": "sample string 5",
    "Objid": [],
  }
  Objid = [];
  ionViewDidLoad() {
    console.log('动态 ionViewDidLoad DynamicPage');
  }

  /**
  * 关闭页面
  */
  dismiss() {
    this.viewCtrl.dismiss();
  }
  //获取列表
  GetGroupByUserId() {
    this.api.postBody("V1/GetGroupByUserId", {})
      .then(data => {
        this.Objid = [];
      })
      .catch(error => {

      })
  }


  /**
   * 上传视频
   * @memberof DynamicPage
   */
  upVideo() {

  }


  /**
   * 上传图片
   */
  upPic() {

  }
  /**
   * 发布动态
   */
  FaBuDynamicItems() {
    this.api.postBody("V1/FaBuDynamicItems", {
      "Describe": "",
      "VideoUrl": "",
      "PicList": [],
      "GeRenPage": true, 
      "IsOpen": true, //是否公开
      "GroupId": []
    })
      .catch(data => {
        if (data.Code == 0) {

        } else {

        }
      })
      .then()
  }

  /**
 * 
 * @param event 
 * @param data 
 */
  filteremoji(event, data) {

  }
}
